/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../../model/baseModel';

const { adminPath } = useGlobSetting();

export interface WmsEssTask extends BasicModel<WmsEssTask> {
  code?: string; // 任务编码
  taskType?: string; // 任务类型
  busType?: string; // 业务类型
  busKey?: string; // 业务key
  boxCode?: string; // 箱子编码
  posCode?: string; // 缓存货位编码
  areaCode?: string; // 所属区域编码
  command?: string; // 指令
  overDate?: string; // 完成日期
  errCode?: string; // 错误编码
  errMsg?: string; // 错误描述
  taskStatus?: string; // 任务状态
}

export const wmsEssTaskList = (params?: WmsEssTask | any) =>
  defHttp.get<WmsEssTask>({ url: adminPath + '/wms/task/wmsEssTask/list', params });

export const wmsEssTaskListData = (params?: WmsEssTask | any) =>
  defHttp.post<Page<WmsEssTask>>({ url: adminPath + '/wms/task/wmsEssTask/listData', params });

export const wmsEssTaskForm = (params?: WmsEssTask | any) =>
  defHttp.get<WmsEssTask>({ url: adminPath + '/wms/task/wmsEssTask/form', params });

export const wmsEssTaskSave = (params?: any, data?: WmsEssTask | any) =>
  defHttp.postJson<WmsEssTask>({ url: adminPath + '/wms/task/wmsEssTask/save', params, data });

export const wmsEssTaskDelete = (params?: WmsEssTask | any) =>
  defHttp.get<WmsEssTask>({ url: adminPath + '/wms/task/wmsEssTask/delete', params });

export const wmsEssTaskCallback = (params?: any, data?: WmsEssTask | any) =>
  defHttp.postJson<WmsEssTask>({ url: '/wms/ess/task/v1/callback', params, data });
